import java.util.Random;
import java.util.Scanner;

public class note1 {

    //1.求0~999999之间类似“水仙花数”这样的数字
    public static void main1(String[] args) {
        //1.计位
        for(int i=1;i<1000000;i++){
            //1.计位
            int temp=i;
            int count=0;
            while(temp!=0){
                count++;
                temp/=10;
            }
            //求和
            temp=i;
            int sum=0;
            while(temp!=0){
                sum+=Math.pow((temp%10),count);
                temp/=10;
            }
            //3.判断是否输出
            if(sum==i){
                System.out.println(i);
            }

        }

    }


    //2.求1~100之间有多少个数字9
    public static void main2(String[] args) {
        int count=0;
        for(int i=1;i<=100;i++){
            if(i/10==9){
                count++;
            }
            if(i%10==9){
                count++;
            }
        }
        System.out.println(count);
    }


    //3.求1~100之间有多少个数字包含9
    public static void main3(String[] args) {
        int count=0;
        for(int i=1;i<=100;i++){
            if(i/10==9){
                count++;
            }
            else if(i%10==9){
                count++;
            }
        }
        System.out.println(count);
    }


    //4.求最大公约数——（辗转相除法）
    public static void main4(String[] args) {

        int a=30;
        int b=15;
        int c=0;
        while(a%b!=0){
            c=a%b;
            a=b;
            b=c;
        }
        System.out.println(b);
    }

    //5.输入与输出
    public static void main5(String[] args) {
        //异常情况：
        Scanner cin = new Scanner(System.in);
        System.out.println("输入年龄：");
        int age = cin.nextInt();
        System.out.println("年龄:" + age);

        System.out.println("输入姓名：");
        String name = cin.nextLine();
        System.out.println("姓名：" + name);


        System.out.println("输入体重：");
        double weight = cin.nextDouble();
        System.out.println("体重:" + weight);
    }


    //6.生成一个随机数
    public static void main6(String[] args) {
        Random x = new Random();
        int a = x.nextInt(150);//[0,100)
        System.out.println(a);

        int b = x.nextInt(150);//[0,150)
        System.out.println(b);
    }


    //7.猜数字游戏
    public static void main7(String[] args) {

    }


    //8.自定义方法
    public static void print() {
        System.out.println("hhhaaa");
    }

    public static void main8(String[] args) {
        print();
    }

    //9.多组输入
    public static void main9(String[] args) {

        Scanner scan = new Scanner(System.in);
        int x = scan.nextInt();
        System.out.println(x);
        while (scan.hasNext()) {

            x = scan.nextInt();
            System.out.println(x);
        }



    }

    //10.溢出
    public static void main10(String[] args) {
        byte a=127;

        a+=2;
        System.out.println(a);


    }

    //11.求1-1/2+1/3-1/4+...-1/10的和
    public static void main11(String[] args) {
        double sum=0;
        double temp=1;
        for(int i=1;i<11;i++){
            sum+=1/(i*temp);
            temp=-temp;
        }
        System.out.println(sum);
    }

    //12.打印X图形
    public static void main(String[] args) {
        Scanner cin=new Scanner(System.in);
        int x=cin.nextInt();
        for(int i=0;i<x;i++){
            for(int j=0;j<x;j++){
                if(i==j||i+j==x-1){
                    System.out.print("*");
                }
                else{
                    System.out.print(" ");
                }
            }
            System.out.println();
        }
    }
}